<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('cate_id');
            $table->integer('tag_id')->nullable();
            $table->integer('user_id');
            $table->string('title')->default('');
            $table->string('keywords')->default('');
            $table->string('description')->default('');
            $table->longText('content')->nullable();
            $table->integer('comment_num')->default(0);
            $table->integer('read_num')->default(0);
            $table->tinyInteger('status')->default(1);
            $table->tinyInteger('order')->default(0);
            $table->longText('html_content')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article');
    }
}
